<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
   String basePath = "http://" + request.getLocalAddr() + ":" + request.getLocalPort() + request.getContextPath();
%>
<html>
<title>${promptInfo.totalDescInfo}</title>
<head>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/datePicker/WdatePicker.js"></script>
<script type="text/javascript">
var gridtb;
$(document).ready(function(){	
	$("#selectMenu").selectTB({	
		//传值元素ID
		valElementID:'select_default_value',	
		//显示元素ID
		textElementID:'select_default_text',			
		//下拉宽度
		selectWidth:'200',
		//下拉高度	
		selectHeight:'16',	
		//树根描述
		rootName:'',		
		primkeyColumn:'orgID',
		//要进行树型显示的列，支持一列
		selectShowColumn:'orgName',
		//树型下拉树列表，起始根值
		nodeStartValue:'${session.s_userOrgID}', 
		//描述树形菜单子列
		childNodeColumn:'orgID',
		//描述树形菜单父列
		parentNodeColumn:'orgParentID',	
    	//ajax 获取所有树json格式信息
    	ajax:{
			//ajax请求url
			url:'ajaxAction.action', 
			//ajax请求参数
			data:'code=${pmsIndex.sys_org_mgr.code}'
		}
	},{
	   animated:false
   });
	var ujdata = {
		    globalParam:$("#actionForm").formSerialize(),
		    //first,last
	    	checkbox:{name:'全选',type:'first',width:'8%'},
	    	shortcut:{
	    		name:'操作',
		    	url:'decorateForwardAction.action',
		    	width:'10%',
		    	event:[
		    		{operate:'del',name:'删除',isvalid:'${!empty pmsIndex.sys_ol_delete}',param:'code=${pmsIndex.sys_ol_delete.code}'}
		        ]
		    },
	    	columnDesc:{
		    	//列表要显示的列（在json中对应的key）
				showColumn: ['orgName','userName','olOperateTime1','olContent'],
				//列表头显示名称
				columnName:   ['所属部门','用户姓名','记录日期','操作内容'],
				//列表头宽度
				columnWidth:   ['10%','10%','20%','40%'],
				//可以作为主键的类，在页面传送的过程中为paramMap.orgID=value的形式
				//多个主键的时候为["orgID","orgCode"]:paramMap.orgID=value&paramMap.orgCode=value
				primkeyColumn:["olID"]
				//要增加链接的列，可以为多个
				//linkColumn:[{name:'',url:'',param:''}]
	    	},		
	    	ajax:{
	        	url:'ajaxAction.action',
	        	data:'code=${code}'
		    },
		    //是否有分页工具条
		    isPagination:'true',	    
	    	paginationData:{
				pageSize:'10'
	    	}		    		 
		};
	var ujoption = {};
	    $('#grid').gridTB(ujdata,ujoption);
        $("#search_ol").click(function(){
        	ujdata = $.extend(ujdata,{globalParam:$("#actionForm").formSerialize()})
        	$('#grid').gridTB(ujdata,ujoption);
         });

        $('#delete_ol').screenTB({
        	windowDocument:window.parent.document,
    		width:'250',
    		height:'150',
    		content:'测试内容',
    		contentAlign:'center',
    		contentValign:'middle',
			title:'系统提示信息',
			buttonValueYes:'确定',	
			buttonValueNo:'取消',	
			dialogType:'alert',
			iframeSrc:''				
    		},{
    		clickEvent:function(data){
    			if ($("#grid tbody input[type='checkbox']:checked").size() == 0){
    				data = $.extend(data,{content:'请选择您要删除的日志记录！'})
    				return false;
    			}
    			else{
    				var olID="";
    				$("#grid tbody input[type='checkbox']:checked").each(function(){
    					olID+=$(this).val()+",";
    				})
    				olID = olID.substring(0,olID.length-1);
    				window.location.href = "decorateForwardAction.action?code=${pmsIndex.sys_ol_delete.code}&paramMap.olID="+olID;
    				return true;
    			}
    		}
    	});
        $("#export_ol").click(function(){
			$("#name1").val($("#name").val());
			$("#timeStart1").val($("#timeStart").val());
			$("#timeEnd1").val($("#timeEnd").val());
			$("#select_default_value1").val($("#select_default_value").val());
			$("#dataForm").submit();
         });
});
</script>
</head>
<body>
<form name="actionForm" method="post" action="decorateForwardAction.action?code=${!empty pmsIndex.sys_ol_search ? pmsIndex.sys_ol_search.code : ''}" id="actionForm">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableC">
<tr>
 <td class="tableCleft">&nbsp;</td>
 <td class="tableCcenter" align="right">
 <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="SkyTDLine">
   <tr>
     <td class="SkyTDLine">
        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="SkyTableLine">
             <tr align="center" class="MeNewTDLine">
                <td align="right" class="SkyTDLine" width="10%">&nbsp;所属部门：</td>
				<td align="left" class="SkyTDLine" width="30%" style="padding:1px 0 1px 6px;">
                <div id="selectMenu">
					<input type="hidden"  id="select_default_value" name="searchMap.select_default_value">
                    <input type="hidden" id="select_default_text" name="searchMap.select_default_text">
				</div>
				</td>
				<td align="right" class="SkyTDLine" width="10%">&nbsp;用户姓名：</td>
				<td align="left" class="SkyTDLine" width="30%">
					&nbsp;&nbsp;<input type="text" name="searchMap.name" id="name" style="width: 200;" />
				</td>
                <td align="center" rowspan="3" class="SkyTDLine" width="20%">
				<s:if test="pmsIndex.sys_ol_search">
				<a href="#" id="search_ol"><img src="<%=request.getContextPath()%>/${pmsIndex.sys_ol_search.icon}" align="absmiddle" width="14" border="0" height="14">${pmsIndex.sys_ol_search.name}</a>
			    </s:if>
				</td>
            </tr>
			<tr align="center" class="MeNewTDLine">
				<td align="right" class="SkyTDLine" width="10%">&nbsp; 起始日期：</td>
				<td align="left" class="SkyTDLine"  width="30%">
				 &nbsp;&nbsp;<input type="text" class="Wdate" name="searchMap.timeStart" id="timeStart" onFocus="WdatePicker({isShowWeek:true,isShowClear:false,startDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'%y-%M-%d'});" style="width: 200;" />
				</td>
				<td align="right" class="SkyTDLine" width="10%">&nbsp;结束日期：</td>
				<td align="left" class="SkyTDLine" width="30%">
				  &nbsp;&nbsp;<input type="text" class="Wdate" name="searchMap.timeEnd" id="timeEnd" onFocus="WdatePicker({isShowWeek:true,isShowClear:false,startDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'%y-%M-%d'});" style="width: 200;" />
				</td>
			</tr>
          </table>
        </td>
     </tr>
  </table>			    	
 </td>
 <td class="tableCright">&nbsp;</td>
 </tr>
<tr>
 <td class="tableCleft">&nbsp;</td>
 <td class="tableCcenter" align="right">
  	<table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" class="SkyTableLine">
       <tr>
         <td class="SkyTDLine" align="right" style="background:#9CC7FF;height:22;" >
	<s:if test="pmsIndex.sys_ol_export">
	<a id="export_ol" href="#"><img src='<%=request.getContextPath()%>/${pmsIndex.sys_ol_export.icon}' align="absmiddle" width="14" border="0" height="14">${pmsIndex.sys_ol_export.name}</a>
</s:if>
<s:if test="pmsIndex.sys_ol_delete">
	<a id="delete_ol" href="#"><img src='<%=request.getContextPath()%>/${pmsIndex.sys_ol_delete.icon}' align="absmiddle" width="14" border="0" height="14">${pmsIndex.sys_ol_delete.name}</a>
</s:if>
   </td>
        </tr>
      </table>   
   </td>
  <td class="tableCright">&nbsp;</td>
</tr>
          <tr>
              <td class="tableCleft">&nbsp;</td>
              <td class="tableCcenter">
                  <table width="100%" border="0" align="left" cellpadding="0" cellspacing="1" class="SkyTDLine">
                      <tr>
                          <td valign="top" colspan="6" id="paginationList" class="MeNewTDLine"><div id="grid"></div>&nbsp;</td>
                      </tr>
                  </table>
              </td>
              <td class="tableCright">&nbsp;</td>
          </tr>
      </table>
</form>
<form name="dataForm" method="post" action="decorateForwardAction.action?code=${pmsIndex.sys_ol_export.code}" id="dataForm">
	<input type="hidden" id="name1" name="paramMap.name1"/>
	<input type="hidden" id="timeStart1" name="paramMap.timeStart1"/>
	<input type="hidden" id="timeEnd1" name="paramMap.timeEnd1"/>
	<input type="hidden" id="select_default_value1" name="paramMap.select_default_value1"/>
</form>
  </body>
</html>